package com.sparrow.socket.http.bean;

import java.util.HashMap;
import java.util.Map;

public class HttpResponse {
    /**
     * 包id
     */
    private String packetId;
    /**
     * 状态码
     */
    private int code;
    /**
     * 结果
     */
    private Map<String, Object> results;

    public HttpResponse() {

    }

    public HttpResponse(int packetId) {
        this.packetId = String.valueOf(packetId);
    }

    public void addResult(String key, Object val) {
        if (results == null) {
            this.results = new HashMap<>();
        }
        results.put(key, val);
    }

    public String getPacketId() {
        return packetId;
    }

    public void setPacketId(String packetId) {
        this.packetId = packetId;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Map<String, Object> getResults() {
        return results;
    }

    public void setResults(Map<String, Object> results) {
        this.results = results;
    }
}
